Either

sealed interface Either<L, R>(source)

Represents one of the possible values.

Inheritors

Types

Link copied to clipboard
object Companion
Link copied to clipboard
data class Left<L, R> : Either<L, R>
Link copied to clipboard
data class Right<L, R> : Either<L, R>

Properties

Link copied to clipboard
open val isLeft: Boolean
Link copied to clipboard
open val isRight: Boolean

Inherited functions

Link copied to clipboard
inline fun <L, R, O> Either<L, R>.fold(ifLeft: (L) -> O, ifRight: (R) -> O): O
Link copied to clipboard
inline fun <L, R> Either<L, R>.ifLeft(action: (L) -> Unit): Either<L, R>
Link copied to clipboard
inline fun <L, R> Either<L, R>.ifRight(action: (R) -> Unit): Either<L, R>
Link copied to clipboard
inline fun <L, R> Either<L, R>.leftOrDefault(default: L): L
Link copied to clipboard
inline fun <L, R> Either<L, R>.leftOrElse(action: (R) -> L): L
Link copied to clipboard
inline fun <L, R> Either<L, R>.leftOrNull(): L?
Link copied to clipboard
inline fun <L, R> Either<L, R>.leftOrThrow(): L
Link copied to clipboard
inline fun <L, R, O> Either<L, R>.mapLeft(action: (L) -> O): Either<O, R>
Link copied to clipboard
inline fun <L, R, O> Either<L, R>.mapRight(action: (R) -> O): Either<L, O>
Link copied to clipboard
inline fun <L, R> Either<L, R>.rightOrDefault(default: R): R
Link copied to clipboard
inline fun <L, R> Either<L, R>.rightOrElse(action: (L) -> R): R
Link copied to clipboard
inline fun <L, R> Either<L, R>.rightOrNull(): R?
Link copied to clipboard
inline fun <L, R> Either<L, R>.rightOrThrow(): R
Link copied to clipboard
inline fun <L, R> Either<L, R>.swap(): Either<R, L>